package com.diko.educms.controller;

import com.diko.commonUtils.R;
import com.diko.educms.entity.EduBanner;
import com.diko.educms.service.EduBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * * <p>
 *  * 首页banner表 前端控制器
 *  * </p>
 * @author Emma Li
 * @date 2020/10/13 - 19:49
 */
@RestController
@RequestMapping("/educms/bannerFront")
@CrossOrigin
@Api(description = "网址首页Banner列表")
public class BannerFrontController {

    @Autowired
    private EduBannerService bannerService;

    @ApiOperation(value = "获取首页banner")
    @GetMapping("getAllBanner")
    public R index(){
        List<EduBanner> list= bannerService.selectIndexList();
        return R.ok().data("bannerList",list);
    }
}
